package com.chenxin.wms.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.chenxin.wms.mapper.CustomerMapper;
import com.chenxin.wms.domain.CustomerEntity;
import com.chenxin.wms.service.ICustomerService;

/**
 * 客户资料Service业务层处理
 *
 * @author gry
 * @date 2025-04-10
 */
@Service
public class CustomerServiceImpl implements ICustomerService {
    @Autowired
    private CustomerMapper customerMapper;

    /**
     * 查询客户资料
     *
     * @param customerId 客户资料主键
     * @return 客户资料
     */
    @Override
    public CustomerEntity selectCustomerByCustomerId(Long customerId) {
        return customerMapper.selectCustomerByCustomerId(customerId);
    }

    /**
     * 查询客户资料列表
     *
     * @param customerEntity 客户资料
     * @return 客户资料
     */
    @Override
    public List<CustomerEntity> selectCustomerList(CustomerEntity customerEntity) {
        return customerMapper.selectCustomerList(customerEntity);
    }

    /**
     * 新增客户资料
     *
     * @param customerEntity 客户资料
     * @return 结果
     */
    @Override
    public int insertCustomer(CustomerEntity customerEntity) {
        return customerMapper.insertCustomer(customerEntity);
    }

    /**
     * 修改客户资料
     *
     * @param customerEntity 客户资料
     * @return 结果
     */
    @Override
    public int updateCustomer(CustomerEntity customerEntity) {
        return customerMapper.updateCustomer(customerEntity);
    }

    /**
     * 批量删除客户资料
     *
     * @param customerIds 需要删除的客户资料主键
     * @return 结果
     */
    @Override
    public int deleteCustomerByCustomerIds(Long[] customerIds) {
        return customerMapper.deleteCustomerByCustomerIds(customerIds);
    }

    /**
     * 删除客户资料信息
     *
     * @param customerId 客户资料主键
     * @return 结果
     */
    @Override
    public int deleteCustomerByCustomerId(Long customerId) {
        return customerMapper.deleteCustomerByCustomerId(customerId);
    }

    @Override
    public List<CustomerEntity> selectCustomerAll() {
        return customerMapper.selectCustomerAll();
    }
}
